package auth_dto

// RegisterRequest 注册请求
type RegisterRequest struct {
	Username string `json:"username" binding:"required,min=3,max=50"`
	Phone    string `json:"phone" binding:"omitempty,len=11"` // 手机号可选
	Password string `json:"password" binding:"required,min=6,max=50"`
}

// LoginRequest 登录请求
type LoginRequest struct {
	Username string `json:"username" binding:"omitempty,min=3,max=50"` // 用户名和手机号二选一
	Phone    string `json:"phone" binding:"omitempty,len=11"`          // 用户名和手机号二选一
	Password string `json:"password" binding:"required"`
}

// LoginResponse 登录响应
type LoginResponse struct {
	UserCode     string `json:"user_code"`
	Username     string `json:"username"`
	Phone        string `json:"phone,omitempty"`
	Token        string `json:"token"`
	RefreshToken string `json:"refresh_token"`
	LoginType    string `json:"login_type"` // username/phone
}

// ChangePasswordRequest 修改密码请求
type ChangePasswordRequest struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required,min=6,max=50"`
}

// BindPhoneRequest 绑定手机号请求
type BindPhoneRequest struct {
	Phone    string `json:"phone" binding:"required,len=11"`
	Password string `json:"password" binding:"required"` // 需要验证密码
}
